﻿@*
    For more information on enabling MVC for empty projects, visit https://go.microsoft.com/fwlink/?LinkID=397860
*@
@{
}


<script>

    //1.定义Persiong函数
    function Person(name, age) {
        this.name = name;
        this.age = age;
    }
    //2.通过原型链给Person添加一个方法
    Person.prototype.getInfo = function () {
        console.log(this.name + " is " + this.age + " years old!");
    }
    function Teacher(staffId) {
        this.staffId = staffId;
    }


    debugger

    //3.通过prototype生命 Teacher继承Person
    Teacher.prototype = new Person();
    //4.实例Teacher函数
    var will = new Teacher(1000);
    will.name = "Will";
    will.age = 28;
    //5.调用父类函数
    will.getInfo();



</script>